package com.yao.netipro.test1;


import redis.clients.jedis.Jedis;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Author: yaoym
 * @Description: 测试Redis秒杀
 * @Date: Created in 16:11 2019/6/28
 * @Modified By:
 */
public class Demo1 {

    public static ThreadPoolExecutor pool = new ThreadPoolExecutor(10, 100, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<>());




    public static void main(String[] args) {
        Jedis jedis = new Jedis("192.168.1.32", 6379);
        jedis.select(0);
        jedis.set("kill_num", "50");
        jedis.del("kill_user");
        jedis.close();


        for (int i = 0; i < 1000; i++) {
            pool.execute(new KillTask());
        }




    }


}
